package com.example.tutormanagement.mapper;

import com.example.tutormanagement.pojo.Charge;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ChargeMapper {
    //连接查询
    @Select("select charge.pid,name,subj,charge from charge,profession_register where charge.pid=profession_register.pid")
    List<Charge> list();

    @Update("update charge set charge=#{charge} where pid=#{pid}")
    void update(Charge charge);

    @Insert("insert into charge(pid,charge) values(#{pid},#{charge})")
    void insert(Charge charge);

    @Select("select charge.pid,name,subj,charge from charge,profession_register where charge.pid=profession_register.pid and charge.pid=#{id}")
    Charge select(String id);

    @Delete("delete from charge where pid=#{id}")
    void delete(String id);
}
